home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / catD / intr.z / intr
Encoding:
Text File  |  2002-10-03  |  7.6 KB  |  199 lines

  1.  
  2.  
  3.  
  4. iiiinnnnttttrrrr((((DDDD2222))))                                                              iiiinnnnttttrrrr((((DDDD2222))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _iiii_nnnn_tttt_rrrr - process a device interrupt
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _vvvv_oooo_iiii_dddd _p_r_e_f_i_x_iiii_nnnn_tttt_rrrr_((((_iiii_nnnn_tttt _i_v_e_c_))))_;;;;
  13.  
  14.    AAAArrrrgggguuuummmmeeeennnnttttssss
  15.      _i_v_e_c      Number used by the operating system to associate a driver's
  16.                interrupt handler with an interrupting device.  For a VME
  17.                device, this number can be the logical device number, the
  18.                interrupt vector number, or the address which is set by
  19.                _vvvv_mmmm_eeee______iiii_vvvv_eeee_cccc______ssss_eeee_tttt(). For a SCSI device, this number is a pointer to
  20.                a _ssss_cccc_ssss_iiii______rrrr_eeee_qqqq_uuuu_eeee_ssss_tttt______tttt type structure.
  21.  
  22. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  23.      The _iiii_nnnn_tttt_rrrr routine is the interrupt handler for both block and character
  24.      hardware drivers, as well as for non-driver hardware modules.
  25.  
  26.    RRRReeeettttuuuurrrrnnnn VVVVaaaalllluuuueeeessss
  27.      None
  28.  
  29. UUUUSSSSAAAAGGGGEEEE
  30.      This entry point is only required for those modules that interface to
  31.      hardware that interrupts the host computer.  It is not used with software
  32.      drivers.
  33.  
  34.      The interrupt handler is responsible for determining the reason for an
  35.      interrupt, servicing the interrupt, and waking up any base-level driver
  36.      processes sleeping on any events associated with the interrupt.
  37.  
  38.      For example, when a disk drive has transferred information to the host to
  39.      satisfy a read request, the disk drive's controller generates an
  40.      interrupt.  The CPU acknowledges the interrupt and calls the interrupt
  41.      handler associated with that controller and disk drive.  The interrupt
  42.      routine services the interrupt and then wakes up the driver base-level
  43.      process waiting for data.  The base-level portion of the driver then
  44.      conveys the data to the user.
  45.  
  46.      In general, most interrupt routines do the following tasks:
  47.  
  48.           keep a record of interrupt occurrences
  49.  
  50.           return immediately if no devices controlled by a driver caused the
  51.           interrupt (only for systems supporting shared interrupts)
  52.  
  53.           interpret the interrupt routine argument _i_v_e_c
  54.  
  55.           reject requests for devices that are not served by the device's
  56.           controller
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. iiiinnnnttttrrrr((((DDDD2222))))                                                              iiiinnnnttttrrrr((((DDDD2222))))
  71.  
  72.  
  73.  
  74.           process interrupts that happen without cause (called spurious
  75.           interrupts)
  76.  
  77.           handle all possible device errors
  78.  
  79.           wake processes that are sleeping on any events associated with the
  80.           interrupt
  81.  
  82.      There are also many tasks the _iiii_nnnn_tttt_rrrr routine must perform that are driver-
  83.      type and device specific.  For example, the following types of drivers
  84.      require different functions from their _iiii_nnnn_tttt_rrrr routines:
  85.  
  86.           A block driver dequeues requests and wakes up processes sleeping on
  87.           an I/O request.
  88.  
  89.           A terminal driver receives and sends characters.
  90.  
  91.           A printer driver ensures that characters are sent.
  92.  
  93.      In addition, the functions of an _iiii_nnnn_tttt_rrrr routine are device dependent.  You
  94.      should know the exact chip set that produces the interrupt for your
  95.      device.  You need to know the exact bit patterns of the device's control
  96.      and status register and how data is transmitted into and out of your
  97.      computer.  These specifics differ for every device you access.
  98.  
  99.      The _iiii_nnnn_tttt_rrrr routine for an intelligent controller that does not use
  100.      individual interrupt vectors for each subdevice must access the
  101.      completion queue to determine which subdevice generated the interrupt.
  102.      It must also update the status information, set/clear flags, set/clear
  103.      error indicators, and so forth to complete the handling of a job.  The
  104.      code should also be able to handle a spurious completion interrupt
  105.      identified by an empty completion queue.  When the routine finishes, it
  106.      should advance the unload pointer to the next entry in the completion
  107.      queue.
  108.  
  109.      If the driver called _bbbb_iiii_oooo_wwww_aaaa_iiii_tttt(D3) or _ssss_llll_eeee_eeee_pppp(D3) to await the completion of
  110.      an operation, the _iiii_nnnn_tttt_rrrr routine must call _bbbb_iiii_oooo_dddd_oooo_nnnn_eeee(D3) or _wwww_aaaa_kkkk_eeee_uuuu_pppp(D3) to
  111.      signal the process to resume.
  112.  
  113.      The interrupt routine runs at the processor level associated with the
  114.      interrupt level for the given device.  Lower priority interrupts are
  115.      deferred while the interrupt routine is active.  Certain processor levels
  116.      can block different interrupts.  See _ssss_pppp_llll(D3) for more information.
  117.  
  118.      _uuuu_iiii_oooo_mmmm_oooo_vvvv_eeee(D3), _uuuu_rrrr_eeee_aaaa_dddd_cccc(D3), and _uuuu_wwww_rrrr_iiii_tttt_eeee_cccc(D3) cannot be used in an interrupt
  119.      routine when the _uuuu_iiii_oooo______ssss_eeee_gggg_ffff_llll_gggg member of the _uuuu_iiii_oooo(D4) structure is set to
  120.      _UUUU_IIII_OOOO______UUUU_SSSS_EEEE_RRRR_SSSS_PPPP_AAAA_CCCC_EEEE (indicating a transfer between user and kernel space).
  121.  
  122.    SSSSyyyynnnncccchhhhrrrroooonnnniiiizzzzaaaattttiiiioooonnnn CCCCoooonnnnssssttttrrrraaaaiiiinnnnttttssss
  123.      The _iiii_nnnn_tttt_rrrr routine must never:
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. iiiinnnnttttrrrr((((DDDD2222))))                                                              iiiinnnnttttrrrr((((DDDD2222))))
  137.  
  138.  
  139.  
  140.           use functions that sleep
  141.  
  142.           drop the interrupt priority level below the level at which the
  143.           interrupt routine was entered
  144.  
  145.           call any function or routine that requires user context (that is, if
  146.           it accesses or alters information associated with the running
  147.           process)
  148.  
  149. RRRREEEEFFFFEEEERRRREEEENNNNCCCCEEEESSSS
  150.      _bbbb_iiii_oooo_dddd_oooo_nnnn_eeee(D3), _bbbb_iiii_oooo_wwww_aaaa_iiii_tttt(D3), _ssss_pppp_llll(D3), _wwww_aaaa_kkkk_eeee_uuuu_pppp(D3), _vvvv_mmmm_eeee______iiii_vvvv_eeee_cccc______ssss_eeee_tttt(D3X)
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.